const Router=require('koa-router');
const router=new Router();
const con=require('./contorl');
router.get('/',con.index); 
router.post('/login',con.login);
router.post('/user',con.login);
router.get('/getmessage',con.getmessageall);
router.get('/getmessage/:id',con.getmessage);
router.get('/editmessage/:id',con.geteditmessage);
router.post('/editmessage/:id',con.editmessage);
router.post('/addmessage',con.addmessage);
router.post('/delmessage',con.delmessage);
router.all('/*', async (ctx, next) => {
    ctx.response.status = 404;
    ctx.response.body = '<h1>404 Not Found</h1>';
});
module.exports=router;
